import Vue from 'vue'
import App from './App.vue'
//引入路由组件
import router from './router'
//引入全局组件
//1.三级联动
import Typenav from './components/Typenav/nav'
Vue.component(Typenav.name,Typenav)
//2.轮播图
import Carousel from './components/Carousel/carousel'
Vue.component(Carousel.name,Carousel)
//3.分页器
import Pagination from './components/Pagination/page'
Vue.component(Pagination.name,Pagination)

//1.引入vuex仓库
import store from './store/vuex'
//2.引入mock模拟数据
import './mock/mockserve.js'
//3.引入轮播图样式
import "swiper/css/swiper.min.css"
//4.引入接口
import * as API from './api/index'
//5.引入element UI
// import {Button,MessageBox} from 'element-ui'
// Vue.component(Button.name,Button);
// Vue.prototype.$msgbox = MessageBox;
// Vue.prototype.$alert = MessageBox.alert;
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

//6.引入懒加载
import VueLazyload from 'vue-lazyload'
import atm from '@/assets/images/icons.png'
Vue.use(VueLazyload,{
  loading:atm
})

//7.引入表单校验插件
import '@/plugins/validate'

Vue.config.productionTip = false


new Vue({
  render: h => h(App),
  router,//注册路由
  store,//注册仓库（$store）
  //全局事件总线
  beforeCreate() {
    Vue.prototype.$bus=this
    Vue.prototype.$API=API
  },
}).$mount('#app')
